import service from './service'

export default {
	goods: {
		goodsType: params => service('/goods/category', params, 'get'), // 商品类别
		goodsList: params => service('/goods/list', params, 'get'), // 商品列表
		goodsDetail: params => service('/goods/info', params, 'get'), // 商品详情
		goodsAmount: params => service('/order/data', params, 'get'), // 商品详情
		getFirst: params => service('/goods/first', params, 'get'), // 一级分类
		getMember: params => service('/member/list', params, 'get'), // 一级分类
	},
	user: {
		setInfo: params => service('/member/edit', params, 'post'), // 设置头像
		phoneApi: params => service('/wechat/wx_phone', params, 'get'), // 获取手机号
		getOpenid: params => service('/wechat/get_openid', params, 'get'), // 获取openid
		getUserInfo: params => service('/member/info', params, 'get'), // 用户详情
		setAuth: params => service('/member/auth', params, 'post'), // 实名认证
		getBalance: params => service('/member/balance', params, 'get') // 资金明细
	},
	order: {
		getShopCart: params => service('/order/cart', params, 'get'), // 购物车
		addCart: params => service('/order/cart', params, 'post'), // 添加到购物车
		delCart: params => service('/order/cart', params, 'put'), // 删除
		createOrder: params => service('/order/orders', params, 'post'), // 创建提交订单
		getWxpay: params => service('/order/wxpay', params, 'post'), // 获取支付数据
		getOrderList: params => service('/order/orders', params, 'get'), // 获取订单列表
		confirmOrder: params => service('/order/confirm', params, 'get'), // 确认收货
		getOrderDetail: params => service('/order/orders/' + params.id, params, 'get'), // 订单详情
		checked: params => service('/order/checked/', params, 'put'),
		withdraw: params => service('/order/withdraw', params, 'post'), //提现
		refund: params => service('/order/applyRefund', params, 'post'), //申请售后
	},
	address: {
		getAddress: params => service('/member/address', params, 'get'), // 获取我的收货地址
		addAddress: params => service('/member/address', params, 'post'), // 新增我的收货地址
		editAddress: params => service('/member/address', params, 'put'), // 修改我的收货地址
		delAddress: params => service('/member/' + params.id, params, 'delete'), // 删除我的收货地址
	},
	// 付费会员和额度
	paymemberlimit: {
		types: params => service('/member/types', params, 'get'),
		recharge: params => service('/order/recharge', params, 'get'),
		rechargeBalance: params => service('/order/rechargeBalance', params, 'get')
	}
}